package com.whu.waterworks.action;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

import com.opensymphony.xwork2.ActionSupport;
import com.whu.waterworks.service.StationTypeCheckService;

public class GisStationTypeAction extends ActionSupport {
	/**
	 * 
	 */
	private static final long serialVersionUID = 5178311694384505125L;
	private String code;
	private Set<String> types;
	private StationTypeCheckService stationTypeCheckService;

	public String getStationTypes() {
		types = new HashSet<>();
		List<String> list = stationTypeCheckService.getTypes(code);
		if (list != null) 
		{
			for(String type:list)
			{
				if(type.contains("流量"))
				{
					types.add("流量");
				}
				else if(type.contains("压力"))
				{
					types.add("压力");
				}
				else if(type.contains("浊度"))
				{
					types.add("浊度");
				}
				else if(type.contains("余氯"))
				{
					types.add("余氯");
				}
			}
		}
		return SUCCESS;
	}

	
    

	public Set<String> getTypes() {
		return types;
	}




	public void setTypes(Set<String> types) {
		this.types = types;
	}




	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public StationTypeCheckService getStationTypeCheckService() {
		return stationTypeCheckService;
	}

	public void setStationTypeCheckService(
			StationTypeCheckService stationTypeCheckService) {
		this.stationTypeCheckService = stationTypeCheckService;
	}



}
